import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import router from "./router";
import PrimeVue from "primevue/config";
import "./assets/main.scss";

// 导入全局加载服务
import { LoadingService } from "./utils/loading";

// 导入 SEO 检查工具（仅在开发环境）
if (import.meta.env.DEV) {
  import("./utils/seoChecker");
}

// PrimeVue样式
import "primevue/resources/themes/lara-light-teal/theme.css";
import "primevue/resources/primevue.min.css";
import "primeicons/primeicons.css";

const app = createApp(App);
const pinia = createPinia();
app.use(pinia);
app.use(router);
app.use(PrimeVue, { ripple: true });

// 注册自定义指令
import Tooltip from "primevue/tooltip";
app.directive("tooltip", Tooltip);

// 注册全局加载服务
app.config.globalProperties.$loading = LoadingService;

app.mount("#app");
